package com.md.common.exception;

import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * 功能描述：认证异常类父类
 *
 * @author lujianping@oak168.com
 * @version 1.0
 * @date 2018-6-14 11:51
 * @since JDK 1.8
 */
public class AuthException extends RuntimeException{
    private static final long serialVersionUID = -7309334982272200665L;

    protected int code;//异常错误码
    protected String message;//异常信息

    public int getCode() {
        return code;
    }
    public void setCode(int code) {
        this.code = code;
    }
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
    public AuthException() {
        super();
    }

    public AuthException(Throwable cause) {
        super(cause);
    }

    public AuthException(int code, String message, Object... objects) {
        super(String.format(message, objects));
        this.code = code;
        this.message = String.format(message, objects);
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
    
}
